<link href="<?php echo base_url()?>/style/validationEngine.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<?php echo base_url()?>script/jquery.validationEngine-<?php echo $this->lang->lang()!=''?$this->lang->lang():'en';?>.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>script/jquery.validationEngine.js"></script>
<div class="middleFront">
    <div class="navigation thirdPageSprite"></div>
    <div class="infoText infoTitle">
        Read this before writing your message
    </div>
    <ul class="informationHelp">
        <li>
            Please be polite, concise and to the point; if you abuse your
            Councillor you devalue the service for all users.
        </li>
        <li>
            Use your own words (new window); we block copy and pasted identical messages.
        </li>
    </ul>
        <?php
            if(validation_errors()){
        ?>
        <div class="errorMessageDiv">
        <?php
              echo validation_errors();
        ?>
        </div>
        <?php
            }

        ?>
    <div class="formHolder">
        <h3>Одговорете на прашањето поставено од: <b><?php echo $sendData['sender_name']?></b>, поставено на <?php echo $sendData['date_created']?></h3>
        <form method="post" action="<?php echo base_url().$this->lang->lang()."/messages/representativeAnswer/".$this->uri->segment(4)."/".$this->uri->segment(5)."/".$this->uri->segment(6);?>" name="messageForm">
            <table width="100%" border="0" class="mainTableFormHolder">
            <tr>
                <td class="textareaHelper">
                    <b><?php echo lang('message')?></b>
                </td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" class="textareaHelper">
                    <input type="hidden" name="rep_id" value="<?php echo (isset($sendData['rep_id']))?$sendData['rep_id']:'';?>">
                    <input type="hidden" name="message_id" value="<?php echo (isset($sendData['message_id']))?$sendData['message_id']:'';?>">
                    <input type="hidden" name="message_token" value="<?php echo (isset($sendData['message_token']))?$sendData['message_token']:'';?>">
                    <textarea name="message" id="message" class="stiliziran textMail" cols="45" rows="15" disabled><?php echo $sendData['message']?></textarea>
                </td>
            </tr>
            <tr>
                <td class="textareaHelper">
                    <b><?php echo lang('the_answer')?></b>
                </td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" class="textareaHelper">
                    <textarea name="answer_message" id="answer_message" class="stiliziran textMail validate[required]" cols="45" rows="15"><?php echo (isset($sendData['answer_message']))?set_value('answer_message',$sendData['answer_message']):''; ?></textarea>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td class="textareaHelper">
                    <div class="previewMessage">
                        <button name="previewMessage" id="send_message"><?php echo lang('send_message')?></button>
                    </div>
                </td>
            </tr>
        </table>
        </form>
    </div>
    <div class="cleardiv"></div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
//        $("form[name=messageForm]").validationEngine();
    });
    $('#send_message').click(function(){
        $('form[name=messageForm]').submit();
    });
</script>

